package com.freshmarket.freshmarket.service.impl;

import com.freshmarket.freshmarket.entity.ProductBatch;
import com.freshmarket.freshmarket.dao.ProductBatchMapper;
import com.freshmarket.freshmarket.service.IProductBatchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Squirrel
 * @since 2020-09-05
 */
@Service
public class ProductBatchServiceImpl extends ServiceImpl<ProductBatchMapper, ProductBatch> implements IProductBatchService {

    final ProductBatchMapper productBatchMapper;

    public ProductBatchServiceImpl(ProductBatchMapper productBatchMapper) {
        this.productBatchMapper = productBatchMapper;
    }

    /**
     * @author Squbi
     * @date 2020/9/7 16:39
     * @Description 查询非过期的商品 以即将过期排序
     */
    @Override
    public List<ProductBatch> selectOldBatch(int productId){
        return productBatchMapper.selectOldBatch(productId);
    }
}
